package com.kingbook.core.enums;


/**
 * @Author: Bucky
 * @Date: 2019/1/2
 * @Version 1.0
 */
public enum PrimaryKeyType {

    UUID10("uuid10"),

    UUID16("uuid16"),

    UUID22("uuid22"),

    UUID32("uuid32"),

    NANO_SECONDS("nano_seconds"),

    FUNCTION("function"),

    AUTO_INCREMENT("auto_increment"),

    SEQUENCE("sequence");

    public String value;

    PrimaryKeyType(String value) {
        this.value = value;
    }


    public static PrimaryKeyType getInstance(String type) {
        for (PrimaryKeyType t : PrimaryKeyType.values()) {
            if (t.value.equalsIgnoreCase(type))
                return t;
        }
        return null;
    }


}
